<html>
    <head>
        <title>First page</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    </head>
    
    <body>
        1 浏览器访问login.php

        2 login.php setcookie("abc",123);

        3 页面返回的头是这样的，带着一个指令 Set-cookie:abc=123
        HTTP/1.1 200 OK
Date: Tue, 10 Mar 2020 07:34:55 GMT
Server: Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.3.14
X-Powered-By: PHP/7.3.14
Set-Cookie: PHPSESSID=fv0qpfsqtph67148cfb3hedcmf; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: abc=123
Content-Length: 386
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8

        4 浏览器接受到这些返回之后，解析头。发现有set-cookie：
            创建一个文件:localhost.cookie.txt abc=123
        
        5 当用户访问localhost的其他页面 register.php
            有localhost.cookie.txt
            文件读出来，把他的内容附在 请求头的cookie

            GET http://localhost:8085/register.phpz HTTP/1.1
            Host: localhost:8085
            Connection: keep-alive
            Pragma: no-cache
            Cache-Control: no-cache
            Upgrade-Insecure-Requests: 1
            User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4077.0 Safari/537.36
            Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
            Sec-Fetch-Site: none
            Sec-Fetch-Mode: navigate
            Sec-Fetch-User: ?1
            Sec-Fetch-Dest: document
            Accept-Encoding: gzip, deflate, br
            Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7
            Cookie: PHPSESSID=fv0qpfsqtph67148cfb3hedcmf; abc=123
        
            6 服务发现请求头带着cookie头，解析cookie到$_COOKIE 数组中， register.php
            


        <table border="1">
            <thead>
                <tr>
                    <th>序号</th>
                    <th>名称</th>
                </tr>
            </thead>
            <tbody>
                <tr> <!-- table row -->
                    <td>1</td> <!-- table data -->
                    <td>yanyi</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>liu chun</td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="2">合计:2</td>
                </tr>
            </tfoot>
        </table>
    </body>
</html>